EMT Practice Test

1. Question Content...


Question List

Question1: Universal Containers wants Opportunities to be locked from editing when reaching the Closed/Won stage.
Which two strategies should a developer use to accomplish this? (Choose two.)

Question2: A developer needs an Apex method that can process Account or Contact records. Which method signature should the developer use?

Question3: When the number of record in a recordset is unknown, which control statement should a developer use to implement a set of code that executes for every record in the recordset, without performing a .size() or
.length() method call?

Question4: What are two valid options for iterating through each Account in the collection List<Account> named AccountList? (Choose two.)

Question5: Which approach should a developer use to add pagination to a Visualforce page?

Question6: Which collection type provides unique key/value pairings of data?

Question7: The operation manager at a construction company uses a custom object called Machinery to manage the usage and maintenance of its cranes and other machinery. The manager wants to be able to assign machinery to different constructions jobs, and track the dates and costs associated with each job. More than one piece of machinery can be assigned to one construction job.
What should a developer do to meet these requirements?

Question8: To which primitive data type in Apex is a currency field atomically assigned?

Question9: The sales management team requires that the lead source field of the Lead record be populated when Lead is converted. What would a developer use to ensure that a user populates the Lead source field?

Question10: How can a developer use a Set<Id> to limit the number of records returned by a SOQL query?

Question11: A developer needs to create records for the object Property__c. The developer creates the following code block:List propertiesToCreate = helperClass.createProperties();try { // line 3 } catch (Exception exp ) {
//exception
handling }Which line of code would the developer insert at line 3 to ensure that at least some records are created, even if a few records have errors and fail to be created?

Question12: Before putting an app into production, which step should be taken?

Question13: A change set deployment from a sandbox to production fails due to a failure in a managed package unit test.
The developer spoke with the manager package owner and they determined it is a false positive and can be ignored. What should the developer do to successfully deploy?

Question14: A developer has the following class and trigger code public class insurancerates{ public static final decimal smokercharge = 0.01; } trigger contacttrigger on contact (before insert){ insurancerates rates = new insurancerates(); decimal basecost=xxx; } Which code segment should a developer insert at the xxx to set the basecost variable to the value of the class variable smokercharge?

Question15: When would a developer use a custom controller instead of a controller extension? Choose 2 answers:

Question16: A developer is asked to create a PDF quote document formatted using the company's branding guidelines, and automatically save it to the Opportunity record.
Which two ways should a developer create this functionality? (Choose two.)

Question17: A visualforce page uses the contact standard controller. How can a developer display the name from the parent account record on the page?

Question18: Which two approaches optimize test maintenance and support future declarative configuration changes?
Choose 2 answers.

Question19: How should a developer make sure that a child record on a custom object, with a lookup to the Account object, has the same sharing access as its associated account?

Question20: Which data structure is returned to a developer when performing a SOSL search?

Question21: Which two sosl searches will return records matching search criteria contained in any of the searchable text fields on an object? choose 2 answers

Question22: Which action can a developer take to reduce the execution time of the following code? List<account> allaccounts = [select id from account]; list<account> allcontacts = [select id, accountid from contact]; for (account a :allaccounts){ for (contact c:allcontacts){ if(c.accountid = a.id){ //do work } } }

Question23: Which three methods help ensure quality data?

Question24: What is a capability of a StandardSetController?Choose 2 answers

Question25: What is the accurate statement about with sharing keyword? choose 2 answers

Question26: In which two trigger types can a developer modify the new sObject records that are obtained by the trigger.new context? Choose 2 answers

Question27: A developer creates an Apex class that includes private methods. What can the developer do to ensure that the private methods can be accessed by the test class?

Question28: A platform developer at Universal Containers needs to create a custom button for the Account object that, when clicked, will perform a series of calculations and redirect the user to a custom Visualforce page.
Which three attributes need to be defined with values in the <apex:page> tag to accomplish this? (Choose three.)

Question29: An Apex transaction inserts 100 Account records and 2,000 Contact records before encountering a DML exception when attempting to insert 500 Opportunity records. The Account records are inserted by calling the database.insert() method with the allOrNone argument set to false. The Contact and Opportunity records are inserted using the standalone insert statement. How many total records will be committed to the database in this transaction?

Question30: Opportunity opp=[select id ,stagename from opportunity limit 1] Given the code above, how can a developer get the label for the stagename field?

Question31: Which two statement can a developer use to throw a custom exception of type MissingFieldValueException?Choose 2 answers

Question32: Which statement should a developer avoid using inside procedural loops? (Choose 2)

Question33: A lead object has a custom field Prior_Email__c. The following trigger is intended to copy the current Email into the Prior_Email__c field any time the Email field is changed:

Which type of exception will this trigger cause?

Question34: What is a good practice for a developer to follow when writing a trigger? (Choose 2)

Question35: Which two queries can a developer use in a Visualforce controller to protect against SOQL injection vulnerabilities? Choose 2 answers

Question36: A sales manager wants to make sure that whenever an opportunity stage is changed to 'Closed Won', a new case will be of created for the support team to collect necessary information from the customer. How should a developer accomplish this?

Question37: Where can a developer identify the time taken by each process in a transaction using Developer Console log inspector?

Question38: When creating unit tests in Apex, which statement is accurate?Choose 2

Question39: Which type of code represents the view in the MVC architecture on the Force.com platform?

Question40: What is a valid statement about Apex classes and interfaces? Choose 2 answers:

Question41: What is the return data type when ApexPages.currentPage().getParameters() is used to retrieve URL parameters from a visualforce controller?

Question42: In a single record, a user selects multiple values from a multi-select picklist.
How are the selected values represented in Apex?

Question43: What is the requirement for a class to be used as a custom Visualforce controller?

Question44: A developer needs to update an unrelated object when a record gets saved. Which two trigger types should the developer create?

Question45: Which statement about change set deployments is accurate? (Choose 3)

Question46: What must the Controller for a Visulforce page utilized to override the standard Opportunity view button?

Question47: What are two valid options for iterating through each Account in the collection List<Account> named AccountList? (Choose two.)

Question48: Given the code block: Integer x; For(x=0;x<10; x+=2) { If(x==8) break; If(x==10) break; } System.debug(x); Which value will the system debug statement display?

Question49: Which statement is true about developing in a multi-tenant environment?

Question50: How can a developer avoid exceeding governor limits when using Apex Triggers? (Choose 2)

Question51: A developer needs to provide a Visualforce page that lets users enter Product-specific details during a Sales cycle. How can this be accomplished? (Choose 2)

Question52: Using the Schema Builder, a developer tries to change the API name of a field that is referenced in an Apex test class.
What is the end result?

Question53: What is a benefit of the lightning component framework?

Question54: The sales team at Universal Containers would like to see a visual indicator appear on both Account and Opportunity page layouts to alert salespeople when an Account is late making payments or has entered the collections process. What can a developer implement to achieve this requirement without having to write custom code?

Question55: A developer needs to include a visualforce page in the detail section of a page layout for the account object, but does not see the page as an available option in the page layout editorwhich attribute must the developer include in the <apex:page> tag to ensure the visualforce page can be embedded in a page layout

Question56: Which trigger event allows a developer to update fields in the Trigger.new list without using an additional DML statement?Choose 2 answers

Question57: A user selects a value from a multi-select picklist. How is this selected value represented in Apex?

Question58: Which Apex collection is used to ensure that all values are unique?

Question59: Which feature allows a developer to create test records for use in test classes?

Question60: Managed Packages can be created in which type of org?

Question61: What would a developer do to update a picklist field on related Opportunity records when a modification to the associated Account record is detected?

Question62: What is considered the primary purpose for creating Apex tests?

Question63: What si the debug output of the following apex code? Decimal thevalue; system.debug(thevalue);

Question64: An Account trigger updates all related Contacts and Cases each time an Account is saved using the following two DML statements:
update allContacts; update allCases;
What is the result if the Case update exceeds the governor limit for maximum number of DML records?

Question65: What is an accurate statement about variable scope? (Choose 3)

Question66: Which two statements are true about using the @testSetup annotation in an Apex test class? (Choose two.)

Question67: When creating a record with a Quick Action, what is the easiest way to post a feed item?

Question68: What is a capability of the Developer Console?

Question69: Which type of code represents the Model in the MVC architecture on the Force.com platform?

Question70: A developer working on a time management application wants to make total hours for each timecard available to applications users. A timecard entry has a Master-Detail relationship to a timecard. Which approach should the developer use to accomplish this declaratively?

Question71: A Visual force page displays two fields named Phone Number and Email.User1 has access to Phone Number, but not to Email.User2 has access to Email, but not Phone NumberA developer needs to ensure that User1 can only see Phone Number, and User2 can only see Email.Which method can the developer use to achieve this?

Question72: Which three options allow a developer to use custom styling in a Visualforce page? (Choose three.)

Question73: Which three statements are true regarding cross-object formulas? Choose 3 answers

Question74: Universal Containers requires Service Representatives to update all Cases at least one every three days. To make sure of this policy is obeyed, a developer has been asked to implement a field that displays the number of days since the last Case update. What should the developer use to configure the solution?

Question75: Which type of code represents the Model in the MVC architecture when using Apex and Visualforce pages?

Question76: A developer needs to display all of the available fields for an object.
In which two ways can the developer retrieve the available fields if the variable myObject represents the name of the object? (Choose two.)

Question77: Which standard field is required when creating a new contact record?

Question78: What are two considerations for custom Apex Exception classes? Choose 2 answers.

Question79: A developer wants to create a custom object to track Customer Invoices.How should Invoices and Accounts be related to ensure that all Invoices are visible to everyone with access to an Account?

Question80: How can a custom type be identified as unique when added to a Set?

Question81: A Visualforce page has a standard controller for an object that has a lookup relationship to a parent object.
How can a developer display data from the parent record on the page?

Question82: What is the advantage of Salesforce Lightning?